﻿#pragma once

#include <SFML/Graphics.hpp>
#include "../../concrete/graphic/GameplayView.h"
#include "../../helpers/client/ServerAddressDialog.h"
#include "../../helpers/graphic/gameplay/PlayerMenu.h"
#include "../../helpers/graphic/gameplay/GameEnd.h"
#include "../../../domain/models/CardSet.h"
#include "../../../domain/models/Player.h"
#include "../../../domain/network/GameClient.h"
#include "../../../utils/gui/Button.h"

namespace Views {
	namespace Client {
		class GameplayView: public Graphic::GameplayView
		{
		protected:
			Domain::Network::GameClient* client;
			Cards::PlayersCards players_cards;
			Utils::GUI::Button* PlayerInfo;
			Utils::GUI::Button* ConnectedInfo;

		public:
			GameplayView(Domain::Network::GameClient*, Utils::GUI::Form*);

			virtual void startTurn(Players::Player*);
			virtual void endTurn(Players::Player*);
			virtual void openPickPlayersDialog(Cards::PlayersCards players_cards);
			virtual void playerLose(Players::Player*);
			virtual void playerWin(Players::Player*);

		protected:
			virtual void onPlayersPick(sf::Packet);
			virtual void onPlayerLoseDialogClose();
			virtual void onPlayerWinDialogClose();
			virtual Domain::Network::GameClient::OnReceiveData onPlayerLoseDialogClose;
			virtual Domain::Network::GameClient::OnReceiveData onPlayerWinDialogClose;
		};

		class ClientGameplayView: public IClientGameplayView, Graphic::BaseGraphicView
		{
			Domain::Network::GameClient* client;
			Helpers::Client::Gameplay::ServerAddressDialog* server_address_dialog;

		public:
			ClientGameplayView(Domain::Network::GameClient*, Utils::GUI::Form*);

			virtual void openServerAddressDialog();
		protected:
			virtual void serverAddressPick(std::string);

		};
	}
}

